]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Require an explicit --xephyr option
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 27 Aug 2009 18:07:46 +0000 (14:07 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 27 Aug 2009 19:33:47 +0000 (15:33 -0400)
Instead of starting Xephyr automatically, require --xephyr to be
passed explicitly.

This makes the operation easier to understand and has the benefit
of allowing running in Xephyr mode when some other window manager
(like gnome-shell!) is running. We also want to emphasize that
Xephyr is a development tool, and not a good preview of the
user-interface.

http://bugzilla.gnome.org/show_bug.cgi?id=592881

src/gnome-shell.in

index ef15b95c38ad73d79e3b1a41142b37beb80ba5b2..a3bdad8caa5a32618271a5b1e8e3d3658588a905 100644 (file)
@@ -190,7 +190,9 @@ def start_shell():
     else:
         args = []
         
-    args.extend(['mutter', '--mutter-plugins=' + plugin, '--replace'])
+    args.extend(['mutter', '--mutter-plugins=' + plugin])
+    if options.replace:
+        args.append('--replace')
     if options.sync:
         args.append('--sync')
     return subprocess.Popen(args, env=env)
@@ -207,6 +209,8 @@ parser.add_option("", "--debug-command", metavar="COMMAND",
                   help="Command to use for debugging (defaults to 'gdb --args')")
 parser.add_option("-v", "--verbose", action="store_true")
 parser.add_option("", "--sync", action="store_true")
+parser.add_option("", "--xephyr", action="store_true",
+                  help="Run a debugging instance inside Xephyr")
 parser.add_option("", "--geometry", metavar="GEOMETRY",
                   help="Specify Xephyr screen geometry",
                   default="1024x768");
@@ -240,14 +244,6 @@ if gnome_panel_dbus:
 else:
     gnome_panel_pid = pidof("gnome-panel")
 
-# Run in Xephyr if gnome-panel is already running and the user didn't
-# specify --replace. Otherwise, run fullscreen
-if options.replace:
-    run_in_xephyr = False
-else:
-    run_in_xephyr = (metacity_pid != None or compiz_pid != None or
-        gnome_panel_pid != None)
-
 # Figure out whether or not to use GL_EXT_texture_from_pixmap. By default
 # we use it iff we aren't running Xephyr, but we allow the user to
 # explicitly disable it.
@@ -258,7 +254,7 @@ if 'GNOME_SHELL_DISABLE_TFP' in os.environ and \
     use_tfp = False
 else:
     # tfp does not work correctly in Xephyr
-    use_tfp = not run_in_xephyr
+    use_tfp = not options.xephyr
 
 if options.verbose:
     print "Starting shell"
@@ -274,14 +270,14 @@ if options.debug:
 normal_exit = False
 
 try:
-    if run_in_xephyr:
+    if options.xephyr:
         xephyr = start_xephyr()
         # This makes us not grab the org.gnome.Panel name
         os.environ['GNOME_SHELL_NO_REPLACE_PANEL'] = '1'
         shell = start_shell()
     else:
         xephyr = None
-        if gnome_panel_pid is not None:
+        if options.replace and gnome_panel_pid is not None:
             kill_gnome_panel(gnome_panel_pid)
         shell = start_shell()
 
@@ -320,7 +316,7 @@ finally:
     if options.debug:
         termios.tcsetattr(0, termios.TCSANOW, termattrs);
 
-    if not run_in_xephyr and not normal_exit:
+    if not options.xephyr and options.replace and not normal_exit:
         # Restart gnome-panel and window manager
 
         # We don't want to start the new gnome-panel in the current